package com.leadingsoft.pwxk.model;

import java.io.Serializable;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.OneToMany;

import lombok.Data;

@Entity
@Data
public class Area implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Long id;
	private String areaId;
	private String areaName;
	@OneToMany(cascade = CascadeType.ALL)
	@JoinTable(name = "area_region_code", joinColumns = @JoinColumn(name = "area_id",referencedColumnName="areaId"), 
	inverseJoinColumns = @JoinColumn(name = "region_code",referencedColumnName="regioncode"))
	private List<RegionCode> regionCode;
}
